package com.util.tool;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.SharedPreferences;

public class SharedPreferencesHelp {
	private static SharedPreferences sharedPreferences;
	private static android.content.SharedPreferences.Editor editor;

	private SharedPreferencesHelp() {
	}

	@SuppressLint("CommitPrefEdits")
	public static synchronized SharedPreferences getInstanceSharedPreferencesHelp(Context context) {
		if (sharedPreferences == null) {
			sharedPreferences = context.getSharedPreferences("storage", Context.MODE_PRIVATE);
			editor = sharedPreferences.edit();
		}
		return sharedPreferences;
	}

	public static Boolean addLoginInfo(String key, boolean value) {
		editor.putBoolean(key, value);
		return editor.commit();
	}

	public static String getinfo(String key, String value) {
		// TODO
		return sharedPreferences.getString(key, value);
	}
}
